package com.tangyuan.Ali;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

@NoArgsConstructor
@Data
public class AliPayRefund {
    @JsonProperty("alipay_trade_refund_response")
    private AlipayTradeRefundResponseDTO alipayTradeRefundResponse;
    @JsonProperty("sign")
    private String sign;

    @NoArgsConstructor
    @Data
    public static class AlipayTradeRefundResponseDTO {
        @JsonProperty("code")
        private String code;
        @JsonProperty("msg")
        private String msg;
        @JsonProperty("sub_msg")
        private String subMsg;
        @JsonProperty("trade_no")
        private String tradeNo;
        @JsonProperty("out_trade_no")
        private String outTradeNo;
        @JsonProperty("open_id")
        private String openId;
        @JsonProperty("buyer_logon_id")
        private String buyerLogonId;
        @JsonProperty("fund_change")
        private String fundChange;
        @JsonProperty("refund_fee")
        private BigDecimal refundFee;
        @JsonProperty("refund_currency")
        private String refundCurrency;
        @JsonProperty("gmt_refund_pay")
        private String gmtRefundPay;
        @JsonProperty("refund_detail_item_list")
        private List<RefundDetailItemListDTO> refundDetailItemList;
        @JsonProperty("store_name")
        private String storeName;
        @JsonProperty("buyer_user_id")
        private String buyerUserId;
        @JsonProperty("send_back_fee")
        private String sendBackFee;
        @JsonProperty("refund_preset_paytool_list")
        private RefundPresetPaytoolListDTO refundPresetPaytoolList;
        @JsonProperty("refund_charge_amount")
        private String refundChargeAmount;
        @JsonProperty("refund_settlement_id")
        private String refundSettlementId;
        @JsonProperty("present_refund_buyer_amount")
        private String presentRefundBuyerAmount;
        @JsonProperty("present_refund_discount_amount")
        private String presentRefundDiscountAmount;
        @JsonProperty("present_refund_mdiscount_amount")
        private String presentRefundMdiscountAmount;
        @JsonProperty("has_deposit_back")
        private String hasDepositBack;
        @JsonProperty("refund_hyb_amount")
        private String refundHybAmount;
        @JsonProperty("refund_charge_info_list")
        private List<RefundChargeInfoListDTO> refundChargeInfoList;

        @NoArgsConstructor
        @Data
        public static class RefundPresetPaytoolListDTO {
            @JsonProperty("amount")
            private List<BigDecimal> amount;
            @JsonProperty("assert_type_code")
            private String assertTypeCode;
        }

        @NoArgsConstructor
        @Data
        public static class RefundDetailItemListDTO {
            @JsonProperty("fund_channel")
            private String fundChannel;
            @JsonProperty("bank_code")
            private String bankCode;
            @JsonProperty("amount")
            private BigDecimal amount;
            @JsonProperty("real_amount")
            private BigDecimal realAmount;
            @JsonProperty("fund_type")
            private String fundType;
        }

        @NoArgsConstructor
        @Data
        public static class RefundChargeInfoListDTO {
            @JsonProperty("refund_charge_fee")
            private BigDecimal refundChargeFee;
            @JsonProperty("switch_fee_rate")
            private String switchFeeRate;
            @JsonProperty("charge_type")
            private String chargeType;
            @JsonProperty("refund_sub_fee_detail_list")
            private List<RefundSubFeeDetailListDTO> refundSubFeeDetailList;

            @NoArgsConstructor
            @Data
            public static class RefundSubFeeDetailListDTO {
                @JsonProperty("refund_charge_fee")
                private BigDecimal refundChargeFee;
                @JsonProperty("switch_fee_rate")
                private String switchFeeRate;
            }
        }
    }
}
